class UserSessionsController < ActionController::Base

  def new
    @user_session = UserSession.new
  end

  def create
    @user_session = UserSession.new(params[:user_session])
    if @user_session.save
      if params[:user_switch]
        redirect_to :back
      else        
        redirect_to(:users, :notice => 'Login Successful')      
      end
    else
      render :action => "new"      
    end
  end

  def destroy
    @user_session = UserSession.find
    @user_session.destroy
    redirect_to users_url
  end
end